package com.share.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.share.service.SysUserService;
import com.share.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: share-admin
 * 描述：
 * @author: XLX
 * @create: 2022-11-30 22:13
 **/
public class BaseController {

    @Autowired
    HttpServletRequest req;

    @Autowired
    SysUserService sysUserService;

    @Autowired
    RedisUtil redisUtil;




    /**
     * 获取页码
     * @return
     */
    public Page getPage(){
        int current = ServletRequestUtils.getIntParameter(req, "current", 1);
        int size = ServletRequestUtils.getIntParameter(req, "size", 10);
        return new Page(current,size);
    }

}